from django.db import models

class robox_info(models.Model):
    id = models.AutoField(primary_key=True)
    use_people = models.CharField(max_length=100, null=True, blank=True)
    delivery_time = models.CharField(max_length=100, null=True, blank=True)
    robot_id = models.CharField(max_length=100, null=True, blank=True)
    zeno_alias = models.CharField(max_length=100, null=True, blank=True)
    robox_model = models.CharField(max_length=100, null=True, blank=True)
    robot_model = models.CharField(max_length=100, null=True, blank=True)
    sequence_sn = models.CharField(max_length=100, null=True, blank=True)
    cmiit_id = models.CharField(max_length=100, null=True, blank=True)
    usb_netcard_mac = models.CharField(max_length=100, null=True, blank=True)
    lte_ssid = models.CharField(max_length=100, null=True, blank=True)
    lte_passwd = models.CharField(max_length=100, null=True, blank=True)
    sim_number = models.CharField(max_length=100, null=True, blank=True)
    sim_active_time = models.CharField(max_length=100, null=True, blank=True)
    sim_stop_time = models.CharField(max_length=100, null=True, blank=True)
    used_record = models.CharField(max_length=100, null=True, blank=True)
    used_charge = models.CharField(max_length=100, null=True, blank=True)
    is_auto_xunhang = models.CharField(max_length=100, null=True, blank=True)
    numbers = models.CharField(max_length=100, null=True, blank=True)
    maintenance_record = models.CharField(max_length=100, null=True, blank=True)
    other_info = models.CharField(max_length=1000, null=True, blank=True)

class project_info(models.Model):

    project_name = models.CharField(max_length=100, null=True, blank=True)
    project_area = models.CharField(max_length=100, null=True, blank=True)
    project_sqaure = models.CharField(max_length=100, null=True, blank=True)
    robot_id = models.CharField(max_length=100, null=True, blank=True)
    project_people = models.CharField(max_length=100, null=True, blank=True)
    is_arrives = models.CharField(max_length=100, null=True, blank=True)
    regist_env = models.CharField(max_length=100, null=True, blank=True)
    zeno_alias = models.CharField(max_length=100, null=True, blank=True)
    usb_netcard_mac = models.CharField(max_length=100, null=True, blank=True)
    is_power_on = models.CharField(max_length=100, null=True, blank=True)
    trouble_shoot1 = models.CharField(max_length=100, null=True, blank=True)
    trouble_shoot2 = models.CharField(max_length=100, null=True, blank=True)
    trouble_shoot3 = models.CharField(max_length=100, null=True, blank=True)
    trouble_shoot4 = models.CharField(max_length=100, null=True, blank=True)
    trouble_shoot5 = models.CharField(max_length=100, null=True, blank=True)
    trouble_shoot6 = models.CharField(max_length=100, null=True, blank=True)
    trouble_shoot7 = models.CharField(max_length=100, null=True, blank=True)
    trouble_shoot8 = models.CharField(max_length=100, null=True, blank=True)
    trouble_shoot9 = models.CharField(max_length=100, null=True, blank=True)
    is_can_using = models.CharField(max_length=100, null=True, blank=True)
    elevator_number = models.CharField(max_length=100, null=True, blank=True)
    elevator_change = models.CharField(max_length=100, null=True, blank=True)
    charge_loc = models.CharField(max_length=100, null=True, blank=True)
    xunjiain_lianjie = models.CharField(max_length=100, null=True, blank=True)
    guard_ac_number = models.CharField(max_length=100, null=True, blank=True)
    daily_rep_num = models.CharField(max_length=100, null=True, blank=True)
    map_routeid = models.CharField(max_length=100, null=True, blank=True)
    robot_dt_lianddong = models.CharField(max_length=100, null=True, blank=True)
    routineid = models.CharField(max_length=100, null=True, blank=True)
    tryrun = models.CharField(max_length=100, null=True, blank=True)
    sucai_up = models.CharField(max_length=100, null=True, blank=True)
    warning_up = models.CharField(max_length=100, null=True, blank=True)
    daily_rep_up_kehu = models.CharField(max_length=100, null=True, blank=True)
    is_jiaojie = models.CharField(max_length=100, null=True, blank=True)
    peixun_kehu = models.CharField(max_length=100, null=True, blank=True)
    duijie_people = models.CharField(max_length=100, null=True, blank=True)
    phone_num = models.CharField(max_length=100, null=True, blank=True)
    live_area = models.CharField(max_length=100, null=True, blank=True)
    file_url= models.CharField(max_length=100, null=True, blank=True)
    other_info = models.CharField(max_length=1000, null=True, blank=True)

import datetime
class Image(models.Model):
 # url = models.TextField(null=True)
  image = models.ImageField(upload_to=str('image/{time}'.format(time=str(datetime.date.today().strftime("%Y%m/%d")))))
  robot_id= models.OneToOneField(to='project_info',on_delete=models.DO_NOTHING)
  class Meta:
     db_table =  'image'

class robox_infoTips(models.Model):

   tips = models.TextField(null=True)

class project_infoTips(models.Model):

   tips = models.TextField(null=True)

class Picture(models.Model):
    pic = models.BinaryField()
    robot_id = models.OneToOneField(to='robox_info', on_delete=models.DO_NOTHING)
    class Meta:
        db_table = 'picture'

class robot_version(models.Model):
    big_version = models.CharField(max_length=100, null=True, blank=True)
    robox = models.CharField(max_length=100, null=True, blank=True)
    nimbo_app = models.CharField(max_length=100, null=True, blank=True)
    slam = models.CharField(max_length=100, null=True, blank=True)
    ros = models.CharField(max_length=100, null=True, blank=True)
    android_us = models.CharField(max_length=100, null=True, blank=True)
    android_cn = models.CharField(max_length=100, null=True, blank=True)
    ios_us = models.CharField(max_length=100, null=True, blank=True)
    ios_cn = models.CharField(max_length=100, null=True, blank=True)
    ios_guru = models.CharField(max_length=100, null=True, blank=True)
    others = models.TextField(null=True, blank=True)


class faq(models.Model):
    problem = models.CharField(max_length=1000, null=True, blank=True)
    problem_solution = models.TextField(null=True, blank=True)
    release_time = models.CharField(max_length=100, null=True, blank=True) 
    publisher = models.CharField(max_length=100, null=True, blank=True)

class faq_image(models.Model):

    image = models.ImageField(upload_to=str('image_faq/{time}'.format(time=str(datetime.date.today().strftime("%Y%m/%d")))))
    problem_id = models.ForeignKey(to='faq',to_field='id',on_delete=models.DO_NOTHING)
    class Meta:
       db_table =  'image_faq'  